#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// 4、将一个字符串倒序"abcd" --->"dcba"
int main()
{
    char *str = (char *)malloc(100);
    strcpy(str, "abcd");
    int *length = calloc(1, 4);
    *length = strlen(str);
    for (int i = 0; i < *length / 2; i++)
    {
        char temp;
        temp = str[i];
        str[i] = str[*length - 1 - i];
        str[*length - 1 - i] = temp;
    }
    printf("%s", str);
    free(str);
    free(length);
    return 0;
}